package com.zjty.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.zjty.service.UserInfoServiceImpl;

@Controller
public class UserInfoController {
	@Resource
	private UserInfoServiceImpl userInfoServiceImpl;

	@RequestMapping("/")
	public String selectUser(@RequestParam(value = "pageNum", required = false, defaultValue = "1") int pageNum,
			@RequestParam(value = "userName", required = false) String userName,
			@RequestParam(value = "userPhone", required = false) String userPhone,
			@RequestParam(value = "userCreatedate", required = false) String userCreatedate,
			HttpServletRequest request) {
		request.setAttribute("userName", userName);
		request.setAttribute("userPhone", userPhone);
		request.setAttribute("userCreatedate", userCreatedate);
		request.setAttribute("page", userInfoServiceImpl.selectUser(pageNum, userName, userPhone, userCreatedate));
		return "userList";
	}

}
